package com.snow.proto.my_wechat;

import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.4.0)",
    comments = "Source: MyWeChat.proto")
public final class MyWeChatServiceGrpc {

  private MyWeChatServiceGrpc() {}

  public static final String SERVICE_NAME = "com.snow.proto.my_wechat.MyWeChatService";

  // Static method descriptors that strictly reflect the proto.
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<UserId,
      FriendInfoList> METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID =
      io.grpc.MethodDescriptor.<UserId, FriendInfoList>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.snow.proto.my_wechat.MyWeChatService", "GetFriendInfoListByUserId"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              UserId.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              FriendInfoList.getDefaultInstance()))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<AccountPassword,
      UserInfo> METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD =
      io.grpc.MethodDescriptor.<AccountPassword, UserInfo>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.snow.proto.my_wechat.MyWeChatService", "GetUserInfoByAccountPassword"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              AccountPassword.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              UserInfo.getDefaultInstance()))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<GroupId,
      GroupMessages> METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID =
      io.grpc.MethodDescriptor.<GroupId, GroupMessages>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.snow.proto.my_wechat.MyWeChatService", "GetGroupMessagesByGroupId"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              GroupId.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              GroupMessages.getDefaultInstance()))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<GroupMessage,
      SendState> METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID =
      io.grpc.MethodDescriptor.<GroupMessage, SendState>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "com.snow.proto.my_wechat.MyWeChatService", "SendGroupMessageByGroupId"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              GroupMessage.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              SendState.getDefaultInstance()))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<GroupId,
      GroupMessage> METHOD_GET_GROUP_MESSAGE =
      io.grpc.MethodDescriptor.<GroupId, GroupMessage>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
          .setFullMethodName(generateFullMethodName(
              "com.snow.proto.my_wechat.MyWeChatService", "GetGroupMessage"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              GroupId.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              GroupMessage.getDefaultInstance()))
          .build();

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static MyWeChatServiceStub newStub(io.grpc.Channel channel) {
    return new MyWeChatServiceStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static MyWeChatServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new MyWeChatServiceBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static MyWeChatServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new MyWeChatServiceFutureStub(channel);
  }

  /**
   */
  public static abstract class MyWeChatServiceImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     *用于获取好友列表
     * </pre>
     */
    public void getFriendInfoListByUserId(UserId request,
        io.grpc.stub.StreamObserver<FriendInfoList> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID, responseObserver);
    }

    /**
     * <pre>
     *用于获取用户信息
     * </pre>
     */
    public void getUserInfoByAccountPassword(AccountPassword request,
        io.grpc.stub.StreamObserver<UserInfo> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD, responseObserver);
    }

    /**
     * <pre>
     *用于获取群内的信息
     * </pre>
     */
    public void getGroupMessagesByGroupId(GroupId request,
        io.grpc.stub.StreamObserver<GroupMessages> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID, responseObserver);
    }

    /**
     * <pre>
     *用于发送存储消息
     * </pre>
     */
    public void sendGroupMessageByGroupId(GroupMessage request,
        io.grpc.stub.StreamObserver<SendState> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID, responseObserver);
    }

    /**
     * <pre>
     *用于获取新消息
     * </pre>
     */
    public void getGroupMessage(GroupId request,
        io.grpc.stub.StreamObserver<GroupMessage> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_GET_GROUP_MESSAGE, responseObserver);
    }

    @Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID,
            asyncUnaryCall(
              new MethodHandlers<
                UserId,
                FriendInfoList>(
                  this, METHODID_GET_FRIEND_INFO_LIST_BY_USER_ID)))
          .addMethod(
            METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD,
            asyncUnaryCall(
              new MethodHandlers<
                AccountPassword,
                UserInfo>(
                  this, METHODID_GET_USER_INFO_BY_ACCOUNT_PASSWORD)))
          .addMethod(
            METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID,
            asyncUnaryCall(
              new MethodHandlers<
                GroupId,
                GroupMessages>(
                  this, METHODID_GET_GROUP_MESSAGES_BY_GROUP_ID)))
          .addMethod(
            METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID,
            asyncUnaryCall(
              new MethodHandlers<
                GroupMessage,
                SendState>(
                  this, METHODID_SEND_GROUP_MESSAGE_BY_GROUP_ID)))
          .addMethod(
            METHOD_GET_GROUP_MESSAGE,
            asyncServerStreamingCall(
              new MethodHandlers<
                GroupId,
                GroupMessage>(
                  this, METHODID_GET_GROUP_MESSAGE)))
          .build();
    }
  }

  /**
   */
  public static final class MyWeChatServiceStub extends io.grpc.stub.AbstractStub<MyWeChatServiceStub> {
    private MyWeChatServiceStub(io.grpc.Channel channel) {
      super(channel);
    }

    private MyWeChatServiceStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected MyWeChatServiceStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new MyWeChatServiceStub(channel, callOptions);
    }

    /**
     * <pre>
     *用于获取好友列表
     * </pre>
     */
    public void getFriendInfoListByUserId(UserId request,
        io.grpc.stub.StreamObserver<FriendInfoList> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID, getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *用于获取用户信息
     * </pre>
     */
    public void getUserInfoByAccountPassword(AccountPassword request,
        io.grpc.stub.StreamObserver<UserInfo> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD, getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *用于获取群内的信息
     * </pre>
     */
    public void getGroupMessagesByGroupId(GroupId request,
        io.grpc.stub.StreamObserver<GroupMessages> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID, getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *用于发送存储消息
     * </pre>
     */
    public void sendGroupMessageByGroupId(GroupMessage request,
        io.grpc.stub.StreamObserver<SendState> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID, getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     *用于获取新消息
     * </pre>
     */
    public void getGroupMessage(GroupId request,
        io.grpc.stub.StreamObserver<GroupMessage> responseObserver) {
      asyncServerStreamingCall(
          getChannel().newCall(METHOD_GET_GROUP_MESSAGE, getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class MyWeChatServiceBlockingStub extends io.grpc.stub.AbstractStub<MyWeChatServiceBlockingStub> {
    private MyWeChatServiceBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private MyWeChatServiceBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected MyWeChatServiceBlockingStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new MyWeChatServiceBlockingStub(channel, callOptions);
    }

    /**
     * <pre>
     *用于获取好友列表
     * </pre>
     */
    public FriendInfoList getFriendInfoListByUserId(UserId request) {
      return blockingUnaryCall(
          getChannel(), METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID, getCallOptions(), request);
    }

    /**
     * <pre>
     *用于获取用户信息
     * </pre>
     */
    public UserInfo getUserInfoByAccountPassword(AccountPassword request) {
      return blockingUnaryCall(
          getChannel(), METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD, getCallOptions(), request);
    }

    /**
     * <pre>
     *用于获取群内的信息
     * </pre>
     */
    public GroupMessages getGroupMessagesByGroupId(GroupId request) {
      return blockingUnaryCall(
          getChannel(), METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID, getCallOptions(), request);
    }

    /**
     * <pre>
     *用于发送存储消息
     * </pre>
     */
    public SendState sendGroupMessageByGroupId(GroupMessage request) {
      return blockingUnaryCall(
          getChannel(), METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID, getCallOptions(), request);
    }

    /**
     * <pre>
     *用于获取新消息
     * </pre>
     */
    public java.util.Iterator<GroupMessage> getGroupMessage(
        GroupId request) {
      return blockingServerStreamingCall(
          getChannel(), METHOD_GET_GROUP_MESSAGE, getCallOptions(), request);
    }
  }

  /**
   */
  public static final class MyWeChatServiceFutureStub extends io.grpc.stub.AbstractStub<MyWeChatServiceFutureStub> {
    private MyWeChatServiceFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private MyWeChatServiceFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected MyWeChatServiceFutureStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new MyWeChatServiceFutureStub(channel, callOptions);
    }

    /**
     * <pre>
     *用于获取好友列表
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<FriendInfoList> getFriendInfoListByUserId(
        UserId request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID, getCallOptions()), request);
    }

    /**
     * <pre>
     *用于获取用户信息
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<UserInfo> getUserInfoByAccountPassword(
        AccountPassword request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD, getCallOptions()), request);
    }

    /**
     * <pre>
     *用于获取群内的信息
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<GroupMessages> getGroupMessagesByGroupId(
        GroupId request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID, getCallOptions()), request);
    }

    /**
     * <pre>
     *用于发送存储消息
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<SendState> sendGroupMessageByGroupId(
        GroupMessage request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID, getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_FRIEND_INFO_LIST_BY_USER_ID = 0;
  private static final int METHODID_GET_USER_INFO_BY_ACCOUNT_PASSWORD = 1;
  private static final int METHODID_GET_GROUP_MESSAGES_BY_GROUP_ID = 2;
  private static final int METHODID_SEND_GROUP_MESSAGE_BY_GROUP_ID = 3;
  private static final int METHODID_GET_GROUP_MESSAGE = 4;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final MyWeChatServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(MyWeChatServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @Override
    @SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_FRIEND_INFO_LIST_BY_USER_ID:
          serviceImpl.getFriendInfoListByUserId((UserId) request,
              (io.grpc.stub.StreamObserver<FriendInfoList>) responseObserver);
          break;
        case METHODID_GET_USER_INFO_BY_ACCOUNT_PASSWORD:
          serviceImpl.getUserInfoByAccountPassword((AccountPassword) request,
              (io.grpc.stub.StreamObserver<UserInfo>) responseObserver);
          break;
        case METHODID_GET_GROUP_MESSAGES_BY_GROUP_ID:
          serviceImpl.getGroupMessagesByGroupId((GroupId) request,
              (io.grpc.stub.StreamObserver<GroupMessages>) responseObserver);
          break;
        case METHODID_SEND_GROUP_MESSAGE_BY_GROUP_ID:
          serviceImpl.sendGroupMessageByGroupId((GroupMessage) request,
              (io.grpc.stub.StreamObserver<SendState>) responseObserver);
          break;
        case METHODID_GET_GROUP_MESSAGE:
          serviceImpl.getGroupMessage((GroupId) request,
              (io.grpc.stub.StreamObserver<GroupMessage>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @Override
    @SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static final class MyWeChatServiceDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier {
    @Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return MyWeChatProto.getDescriptor();
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (MyWeChatServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new MyWeChatServiceDescriptorSupplier())
              .addMethod(METHOD_GET_FRIEND_INFO_LIST_BY_USER_ID)
              .addMethod(METHOD_GET_USER_INFO_BY_ACCOUNT_PASSWORD)
              .addMethod(METHOD_GET_GROUP_MESSAGES_BY_GROUP_ID)
              .addMethod(METHOD_SEND_GROUP_MESSAGE_BY_GROUP_ID)
              .addMethod(METHOD_GET_GROUP_MESSAGE)
              .build();
        }
      }
    }
    return result;
  }
}
